load("//cuttlefish/package:rules.bzl", "package_files")

package_files(
    name = "cvd",
    executable = "cuttlefish-common/bin/cvd",
    package_file_to_src = {
        "cuttlefish-common/bin/acloud_translator": "//cuttlefish/host/commands/acloud_translator",
        "cuttlefish-common/bin/adb": "//adb:adb",
        "cuttlefish-common/bin/adb_connector": "//cuttlefish/host/frontend/adb_connector",
        "cuttlefish-common/bin/allocd_client": "//cuttlefish/host/libs/allocd:allocd_client",
        "cuttlefish-common/bin/assemble_cvd": "//cuttlefish/host/commands/assemble_cvd",
        "cuttlefish-common/bin/avbtool.py": "@avb//:avbtool.py",
        "cuttlefish-common/bin/casimir_control_server": "//cuttlefish/host/commands/casimir_control_server",
        "cuttlefish-common/bin/cf_vhost_user_input": "//cuttlefish/host/commands/vhost_user_input:cf_vhost_user_input",
        "cuttlefish-common/bin/console_forwarder": "//cuttlefish/host/commands/console_forwarder",
        "cuttlefish-common/bin/control_env_proxy_server": "//cuttlefish/host/commands/control_env_proxy_server",
        "cuttlefish-common/bin/cpio": "@libarchive//cpio:cpio",
        "cuttlefish-common/bin/cuttlefish_example_action_server": "//cuttlefish/host/example_custom_actions:cuttlefish_example_action_server",
        "cuttlefish-common/bin/cvd_import_locations": "//cuttlefish/host/commands/cvd_import_locations",
        "cuttlefish-common/bin/cvd_internal_display": "//cuttlefish/host/commands/display:cvd_internal_display",
        "cuttlefish-common/bin/cvd_internal_env": "//cuttlefish/host/commands/cvd_env:cvd_internal_env",
        "cuttlefish-common/bin/cvd_internal_host_bugreport": "//cuttlefish/host/commands/host_bugreport:cvd_internal_host_bugreport",
        "cuttlefish-common/bin/cvd_internal_start": "//cuttlefish/host/commands/start:cvd_internal_start",
        "cuttlefish-common/bin/cvd_internal_status": "//cuttlefish/host/commands/status:cvd_internal_status",
        "cuttlefish-common/bin/cvd_internal_stop": "//cuttlefish/host/commands/stop:cvd_internal_stop",
        "cuttlefish-common/bin/cvd_send_id_disclosure": "//cuttlefish/host/commands/cvd_send_id_disclosure",
        "cuttlefish-common/bin/cvd_send_sms": "//cuttlefish/host/commands/cvd_send_sms",
        "cuttlefish-common/bin/cvd_update_location": "//cuttlefish/host/commands/cvd_update_location",
        "cuttlefish-common/bin/cvd_update_security_algorithm": "//cuttlefish/host/commands/cvd_update_security_algorithm",
        "cuttlefish-common/bin/cvd": "//cuttlefish/host/commands/cvd",
        "cuttlefish-common/bin/e2fsck": "@e2fsprogs//:e2fsck",
        "cuttlefish-common/bin/e2fsdroid": "@e2fsprogs//:e2fsdroid",
        "cuttlefish-common/bin/echo_server": "//cuttlefish/host/commands/echo_server",
        "cuttlefish-common/bin/extract-ikconfig": "//cuttlefish/host/commands/extract_ikconfig:extract-ikconfig.sh",
        "cuttlefish-common/bin/extract-vmlinux": "//cuttlefish/host/commands/extract_vmlinux:extract-vmlinux.sh",
        "cuttlefish-common/bin/fsck.f2fs": "@f2fs_tools//:fsck.f2fs",
        "cuttlefish-common/bin/fastboot": "//fastboot",
        "cuttlefish-common/bin/fec": "//fec",
        "cuttlefish-common/bin/generate_shader_embed": "//cuttlefish/host/graphics_detector/shaders:generate_shader_embed",
        "cuttlefish-common/bin/gnss_grpc_proxy": "//cuttlefish/host/commands/gnss_grpc_proxy",
        "cuttlefish-common/bin/graphics_detector": "//cuttlefish/host/graphics_detector",
        "cuttlefish-common/bin/health": "//cuttlefish/host/commands/health",
        "cuttlefish-common/bin/kernel_log_monitor": "//cuttlefish/host/commands/kernel_log_monitor",
        "cuttlefish-common/bin/libgfxstream_backend.so": "@gfxstream//host:gfxstream_backend",
        "cuttlefish-common/bin/libvk_lavapipe.so": "@mesa//:vk_lavapipe",
        "cuttlefish-common/bin/libvk_swiftshader.so": "@swiftshader//:vk_swiftshader",
        "cuttlefish-common/bin/log_tee": "//cuttlefish/host/commands/log_tee",
        "cuttlefish-common/bin/logcat_receiver": "//cuttlefish/host/commands/logcat_receiver",
        "cuttlefish-common/bin/lpadd": "//liblp:lpadd",
        "cuttlefish-common/bin/lpmake": "//liblp:lpmake",
        "cuttlefish-common/bin/make_f2fs": "@f2fs_tools//:make_f2fs",
        "cuttlefish-common/bin/metrics_launcher": "//cuttlefish/host/commands/metrics_launcher",
        "cuttlefish-common/bin/metrics": "//cuttlefish/host/commands/metrics",
        "cuttlefish-common/bin/mkbootfs": "//mkbootfs",
        "cuttlefish-common/bin/mkbootimg.py": "@mkbootimg//:mkbootimg.py",
        "cuttlefish-common/bin/mke2fs": "@e2fsprogs//:mke2fs",
        "cuttlefish-common/bin/mke2fs.conf": "//libext4_utils:mke2fs.conf",
        "cuttlefish-common/bin/mkenvimage_slim": "//cuttlefish/host/commands/mkenvimage_slim",
        "cuttlefish-common/bin/mkfs.fat": "@dosfstools//:mkfs.fat",
        "cuttlefish-common/bin/mkuserimg_mke2fs.py": "//libext4_utils:mkuserimg_mke2fs.py",
        "cuttlefish-common/bin/modem_simulator": "//cuttlefish/host/commands/modem_simulator",
        "cuttlefish-common/bin/mtools": "@mtools//:mtools",
        "cuttlefish-common/bin/openwrt_control_server": "//cuttlefish/host/commands/openwrt_control_server",
        "cuttlefish-common/bin/operator_proxy": "//cuttlefish/host/frontend/operator_proxy",
        "cuttlefish-common/bin/powerbtn_cvd": "//cuttlefish/host/commands/powerbtn_cvd",
        "cuttlefish-common/bin/powerwash_cvd": "//cuttlefish/host/commands/powerwash_cvd",
        "cuttlefish-common/bin/process_restarter": "//cuttlefish/host/commands/process_restarter",
        "cuttlefish-common/bin/record_cvd": "//cuttlefish/host/commands/record_cvd",
        "cuttlefish-common/bin/resize2fs": "@e2fsprogs//:resize2fs",
        "cuttlefish-common/bin/restart_cvd": "//cuttlefish/host/commands/restart_cvd",
        "cuttlefish-common/bin/run_cvd": "//cuttlefish/host/commands/run_cvd",
        "cuttlefish-common/bin/screen_recording_server": "//cuttlefish/host/commands/screen_recording_server",
        # "cuttlefish-common/bin/secure_env": "//cuttlefish/host/commands/secure_env", # TODO: schuffelen - make this more complete
        "cuttlefish-common/bin/sefcontext_compile": "@selinux//:sefcontext_compile",
        "cuttlefish-common/bin/sensors_simulator": "//cuttlefish/host/commands/sensors_simulator",
        "cuttlefish-common/bin/simg2img": "//libsparse:simg2img",
        "cuttlefish-common/bin/snapshot_util_cvd": "//cuttlefish/host/commands/snapshot_util_cvd",
        "cuttlefish-common/bin/socket_vsock_proxy": "//cuttlefish/common/frontend/socket_vsock_proxy",
        "cuttlefish-common/bin/tcp_connector": "//cuttlefish/host/commands/tcp_connector",
        "cuttlefish-common/bin/tombstone_receiver": "//cuttlefish/host/commands/tombstone_receiver",
        "cuttlefish-common/bin/unpack_bootimg.py": "@mkbootimg//:unpack_bootimg.py",
        "cuttlefish-common/bin/vk_lavapipe_icd.json": "//cuttlefish/host/graphics/vulkan:vk_lavapipe_icd",
        "cuttlefish-common/bin/vk_swiftshader_icd.json": "//cuttlefish/host/graphics/vulkan:vk_swiftshader_icd",
        "cuttlefish-common/bin/webRTC": "//cuttlefish/host/frontend/webrtc:webRTC",
        "cuttlefish-common/bin/wmediumd": "@wmediumd//:wmediumd",
        "cuttlefish-common/bin/wmediumd_gen_config": "@wmediumd//:wmediumd_gen_config",
        "cuttlefish-common/etc/default_input_devices/keyboard.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/keyboard.json",
        "cuttlefish-common/etc/default_input_devices/mouse.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/mouse.json",
        "cuttlefish-common/etc/default_input_devices/multi_touchpad_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/multi_touchpad_template.json",
        "cuttlefish-common/etc/default_input_devices/multi_touchscreen_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/multi_touchscreen_template.json",
        "cuttlefish-common/etc/default_input_devices/rotary_wheel.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/rotary_wheel.json",
        "cuttlefish-common/etc/default_input_devices/single_touchpad_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/single_touchpad_template.json",
        "cuttlefish-common/etc/default_input_devices/single_touchscreen_template.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/single_touchscreen_template.json",
        "cuttlefish-common/etc/default_input_devices/switches.json": "//cuttlefish/host/commands/vhost_user_input:device_specs/switches.json",
        "cuttlefish-common/etc/cvd_custom_action_config/cuttlefish_example_action_config.json": "//cuttlefish/host/example_custom_actions:custom_action_config.json",
        "cuttlefish-common/etc/modem_simulator/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml",
        "cuttlefish-common/etc/modem_simulator/files/iccprofile_for_sim0.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/iccprofile_for_sim0.xml",
        "cuttlefish-common/etc/modem_simulator/files/numeric_operator.xml": "//cuttlefish/host/commands/modem_simulator:etc/files/numeric_operator.xml",
        # "cuttlefish-common/bin/crosvm": "@crosvm_bin//:crosvm__crosvm", # TODO: b/402274999 - currently requires --enable_sandbox=false

    },
    package_file_symlink_to_package_file = {
        "cuttlefish-common/bin/mcopy": "cuttlefish-common/bin/mtools",
        "cuttlefish-common/bin/mmd": "cuttlefish-common/bin/mtools",
        "cuttlefish-common/bin/resize.f2fs": "cuttlefish-common/bin/fsck.f2fs",
        "cuttlefish-common/bin/aarch64-linux-gnu/gfxstream_graphics_detector": "cuttlefish-common/bin/graphics_detector",
        "cuttlefish-common/bin/aarch64-linux-gnu/libvk_swiftshader.so": "cuttlefish-common/bin/libvk_swiftshader.so",
        "cuttlefish-common/bin/x86_64-linux-gnu/gfxstream_graphics_detector": "cuttlefish-common/bin/graphics_detector",
        "cuttlefish-common/lib64/vulkan.lvp.so": "cuttlefish-common/bin/libvk_lavapipe.so",
        "cuttlefish-common/lib64/vulkan.pastel.so": "cuttlefish-common/bin/libvk_swiftshader.so",
    },
    visibility = ["//:android_cuttlefish"],
)
